#include "widget.h"
#include "ui_widget.h"
#include<QDebug>
#include<QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    this->tch=new Teacher(this);
    this->stu=new Students(this);

    QPushButton* tch_button=new QPushButton(this);
    tch_button->setText("上课了");
    resize(400,400);
    tch_button->move(150,100);
    connect(tch,&Teacher::Mysignal,stu,&Students::StartStudy);

    connect(tch_button,&QPushButton::clicked,tch,&Teacher::Mysignal);
    EmitSignal();
}

void Widget::EmitSignal()
{
    emit tch->Mysignal();
}
Widget::~Widget()
{
    delete ui;
}

